home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / infosrvr / dev / www_talk.930 / 000423_connolly@pixel.convex.com _Wed Dec 2 03:09:11 1992.msg < prev    next >
Internet Message Format  |  1994-01-24  |  4KB

  1. Return-Path: <connolly@pixel.convex.com>
  2. Received: from dxmint.cern.ch by  nxoc01.cern.ch  (NeXT-1.0 (From Sendmail 5.52)/NeXT-2.0)
  3.     id AA05557; Wed, 2 Dec 92 03:09:11 MET
  4. Received: by dxmint.cern.ch (5.65/DEC-Ultrix/4.3)
  5.     id AA03629; Wed, 2 Dec 1992 03:22:20 +0100
  6. Received: from pixel.convex.com by convex.convex.com (5.64/1.35)
  7.     id AA09445; Tue, 1 Dec 92 20:22:17 -0600
  8. Received: from localhost by pixel.convex.com (5.64/1.28)
  9.     id AA20569; Tue, 1 Dec 92 20:22:15 -0600
  10. Message-Id: <9212020222.AA20569@pixel.convex.com>
  11. To: www-talk@nxoc01.cern.ch
  12. Subject: HTML providers: please grab sgmls and the DTD
  13. Date: Tue, 01 Dec 92 20:22:15 CST
  14. From: Dan Connolly <connolly@pixel.convex.com>
  15.  
  16. Tim,
  17.  
  18. I noticed you've been diddling with the HTML files
  19. on info.cern.ch -- quoted your attributes, dotted
  20. your i's and crossed your t's, so to speak.
  21.  
  22. But the files still don't fit into SGML.
  23.  
  24. Please: grab the sgmls-0.8.tar ... wait! there's a 1.0!
  25. on ifi.uio.no in /pub/SGML/SGMLS. I have experience
  26. with the sgmls-0.8.tar.Z -- I know it builds and runs
  27. like a champ. I'll have to check the 1.0 version out.
  28.  
  29. Then check a few of your files by doing
  30.  
  31. % sgmls -s html.dtd yourfile.html
  32.  
  33. If you get errors, either fix your software or
  34. diddle with the DTD until you get something that
  35. works. Even if the official HTML dtd is never
  36. modified to match your data, you'll have _some_
  37. SGML DTD that specifies what you produce.
  38.  
  39. A word of warning: there's a rule-of-thumb everybody
  40. ought to follow in writing DTD's: only used mixed
  41. content for repeatable-or groups. That is, if you've
  42. got an element that can contain a mixture of PCDATA
  43. and elements, don't impose any special order on
  44. the elements.
  45.  
  46. For example: I wanted to do this:
  47.  
  48. <!ELEMENT HTML - - ((TITLE? & ISINDEX?), (H1|H2|DL|OL|XMP|#PCDATA)+)>
  49.  
  50. But then the HTML element would have mixed content (see
  51. the TITLE, H1, elements along with #PCDATA). The problem
  52. is that if you write:
  53.  
  54. <TITLE>foo</title>
  55. <ISINDEX>
  56. <h1>a header</h1>
  57. some data...
  58.  
  59. The newline after </title> is treated as PCDATA, which is not
  60. allowed before ISINDEX. The options you're left with are:
  61.  
  62. 1. Watch out where you put newlines (we hate this.)
  63.  
  64. 2. Use a repeatable-or group, like this:
  65. <!ELEMENT HTML - - (TITLE | ISINDEX | H1|H2|DL|OL|XMP|#PCDATA)*>
  66. Then all your structure is gone (TITLES are allowed anywhere...).
  67.  
  68. 3. Only use element content (move the #PCDATA out
  69.     of the HTML element) like this:
  70. <!ELEMENT HTML - - ((TITLE? & ISINDEX?), BODY>
  71. <!ELEMENT BODY - - (H1|H2|DL|OL|XMP|#PCDATA)+)>
  72. This is what I did.
  73.  
  74. [Notice that these tags are minimizable,
  75. so that existing HTML documents that don't have them are
  76. still legal. This was perhaps a bad idea. For example, I
  77. had to hack the BODY model group badly to get the desired
  78. effect.]
  79.  
  80. I've wrestled quite a bit with the header/body thing, and
  81. I can't seem to come up with a DTD that 1) makes most existing
  82. HTML legal, and 2) imposes _any_ structure on the thing.
  83.  
  84. I'm just about to give up on the structure business. Do any
  85. implementations have problems with <TITLE> elements in
  86. the middle of the document? If not, I can just change the
  87. DTD so that HTML is just "tag soup" -- anything goes anywhere.
  88.  
  89. Another idea is to move the TITLE and other header
  90. info outside the HTML format and MIME messages for
  91. HTTP transport, so that
  92.  
  93. <TITLE>the title</TITLE>
  94. <h1>the header</h1>
  95. ... the text...
  96.  
  97. becomes
  98.  
  99. Subject: the title
  100. Content-type: text/x-html
  101.  
  102. <h1>the header</h1>
  103.  
  104. The header information would be part of the protocol, and
  105. not part of the HTML data. Local files would get their
  106. header information from the filesystem. WAIS documents
  107. would get their header information from the :document
  108. structure.
  109.  
  110. Anyway... get the sgmls parser and validate the data
  111. you provide! I'd like to have more folks than just
  112. me bumping up against the SGML issues.
  113.  
  114. Dan
  115.